package com.ruoyi.web.controller.jl;

import com.ruoyi.common.base.Result;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.jl.service.IHomeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 公告 控制层
 *
 * @author wh
 * @date 2019-04-29
 */
@Slf4j
@Controller
@RequestMapping("/jl/home")
public class HomeController extends BaseController {

    @Autowired
    IHomeService homeService;


    @PostMapping("/revenueGoldlist")
    @ResponseBody
    public Result list(@RequestParam(value = "startTime", required = false) String startTime,
                       @RequestParam(value = "endTime", required = false) String endTime) {
        // @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime
        Map<String, Object> paramMap = new HashMap<>();
        paramMap.put("startTime", startTime);
        paramMap.put("endTime", endTime);
        List<Map<String, Object>> list = homeService.revenueGold(paramMap);
        return Result.success(getDataTable(list));
    }

}
